function get(url, data = {}) {
  return new Promise(function (resolve, reject) {
    wx.request({
      method: "GET",
      url: url,
      data: data,
      success(res) {
        resolve(res);
      },
      fail(err) {
        reject(err)
      }
    })
  })
}

function post(url, data = {}) {
  return new Promise(function (resolve, reject) {
    wx.request({
      method: "POST",
      url: url,
      data: data,
      success(res) {
        resolve(res);
      },
      fail(err) {
        reject(err)
      }
    })
  })
}


module.exports = {
  get,
  post
}